<template>
  <div style="padding: 20rpx">
    <div class="f ac xc cn mt30r">
      <img src="" alt="图片占位" style="height: 200rpx; width: 200rpx" />
      <div class="f rel" style="align-items: baseline">
        <div class="mt20r b" style="color: red; font-size: 100rpx">
          {{ info.studentExamRecords.totalScore }}
        </div>
        <div style="color: #007aff" class="">分</div>
      </div>
      <div v-if="!istg" class="mt20r b" style="color: red; font-size: 50rpx">
        很抱歉！考核并未通过
      </div>
      <div v-else class="mt20r b" style="color: #007aff; font-size: 50rpx">
        恭喜您！考核通过
      </div>
      <div class="f bgf ac xb w100 mt20r tc">
        <!-- <img src="" alt="图片占位" style="height: 100%; width: 200rpx" /> -->
        <div class="f cn f1 ml20r tc" style="padding: 10rpx 0">
          <div class="fs40r b">{{ info.title }}</div>
          <div class="f ac tc w100 mt30r">
            <div class="ga0 tc w100">{{ info.description }}</div>
          </div>
          <!-- 
          <div class="f ac">
            <div class="ga0">及格分数：</div>
            <div>80分（总分100分）</div>
          </div>
          <div class="f ac">
            <div class="ga0">奖励积分：</div>
            <div>8分</div>
          </div> -->
        </div>
      </div>
    </div>
    <div
      class="fixed w90 b2 l50 f ac xb"
      style="padding: 20rpx; transform: translateX(-50%)"
    >
      <button
        class="f1"
        @click="goAnalysis"
        style="background-color: #007aff; color: white"
      >
        返回
      </button>
      <button
        v-if="!istg"
        class="f1 ml20r"
        style="background-color: #007aff; color: white"
      >
        申请补考
      </button>
    </div>
  </div>
</template>

<script>
import { examDetails } from "../../api/index";
export default {
  data() {
    return {
      istg: true,
      id: "",
      info: {},
    };
  },
  onLoad(e) {
    this.id = e.id;
    this.getDetail();
    wx.showShareMenu({
				withShareTicket: true,
				menus: ["shareAppMessage", "shareTimeline"]
			})
  },
  methods: {
    getDetail() {
      examDetails({ paperId: this.id }).then((res) => {
        console.log(res);
        this.info = res.data;
      });
    },
    goAnalysis() {
      uni.reLaunch({
        url: "/pages/answer/index",
      });
    },
  },
};
</script>

<style scoped></style>
